<div  ng-include="'partials/common/crumb/crumb.html'"></div>
<div id="asset" ng-controller="assetCtrl" ng-init="init()">

    <div class="appheader">
        <div class="titleitem"  ng-class=" {'active':assetprofile}" ng-click="assetprofilechange()">{{'ASSET_PROFILE' | translate}}</div>
        <div class="titleitem"  ng-class=" {'active':registerpublish}" ng-click="registerpublishchange()">{{'REGISTERED_PUBLISHER' | translate}}</div>
        <div class="titleitem"  ng-class=" {'active':registerasset}" ng-click="registerAssetchange()">{{'REGISTERED_ASSETS' | translate}}</div>
        <div class="titleitem"  ng-class=" {'active':myAssets}" ng-click="myAssetschange()">{{'MY_ASSETS' | translate}}</div>
        <div class="titleitem"  ng-class=" {'active':operationRecord}" ng-click="operationRecordchange()">{{'OPERATION_RECORD' | translate}}</div>
    </div>
    <div class="content first deal_table" ng-show="assetprofile">
        <table class="table" ng-table="assetprofiletableparams" border="0" width="100%" cellpadding="0" cellspacing="0"
               template-pagination="custom/pager" >
            <thread>
                <tr>
                    <td>{{'ASSET_NAME' | translate}}</td>
                    <td>{{'BALANCE' | translate}}
                    <td>{{'MAXIMUM' | translate}}</td>
                    <td>{{'PRECISION' | translate}}</td>
                    <td>{{'QUANTITY' | translate}} </td>
                    <td>{{'CANCELLATION' | translate}}</td>
                    <td>{{'ALLOW_WWB' | translate}}</td>
                    <td>{{'OPERATION' | translate}}</td>
                </tr>
            </thread>
            <tr ng-repeat="i in $data"  >
                <td> {{i.currency}}</td>
                <td>{{i.balanceShow }}</td>
                <td>{{i.maximumShow}}</td>
                <td>{{i.precision}}</td>
                <td>{{i.quantityShow}}</td>
                <td>{{i.writeoff  }}</td>
                <td>{{i.allowWriteoff ? 'Y' : 'N'}}/{{i.allowWhitelist ? 'Y' : 'N'}}/{{i.allowBlacklist ? 'Y' : 'N'}}</td>
                <td><a class="hand" ng-click="transferView(i,1)">{{'TRANSFER' | translate}}</a></td>
            </tr>
        </table>

    </div>
    <div class="content first" ng-show="registerpublish">
        <p class="title" ng-show="issuerStatus">{{'PUBLISHER_ALREADY_REGISTERED' | translate}}</p>

        <div class="_item">
            <label >{{'DAPP_NAME' | translate}}</label>
            <input type="text" ng-disabled="issuerStatus" maxlength="16" ng-model="monname" id="pay_item1" >
        </div>
        <div class="_item">
            <label >{{'DESCRIBE' | translate}}</label>
            <textarea  required ng-disabled="issuerStatus"  ng-model="mondesc" id="pay_item2"></textarea>

        </div>
        <div class="_item" ng-show="secpwd">
            <form action="">
                <label >{{'SECOND_PASSWORD' | translate}}</label>
                <input type="password"  ng-model="rpsecondPassword"  autocomplete="off">
            </form>
        </div>
        <button class="sent" ng-show="!issuerStatus" ng-click="registerPublish()">{{'SUBMIT' | translate}}</button>
    </div>
    <div class="content third" ng-show="registerasset">
        <div class="_item">
            <label >{{'DAPP_NAME' | translate}}</label>
            <input type="text"  ng-model="publishName" maxlength="6" id="pay_item3" >
        </div>
        <div class="_item">
            <label >{{'DESCRIBE' | translate}}</label>
            <textarea  required ng-model="publishDesc"  id="pay_item4"></textarea>

        </div>
        <div class="_item">
            <label >{{'TOPLIMIT' | translate}}</label>
            <input type="text" ng-model="topLimt" >
        </div>
        <div class="_item">
            <label >{{'ACCURACY' | translate}}</label>
            <input type="text"  ng-model="precision" >
        </div>
        <div class="_item">
            <label >{{'STRATEGY' | translate}}</label>
            <textarea  required  ng-model="strategy" placeholder="{{'STRATEGY_WARNING' | translate}}"></textarea>

        </div>
        <div class="_item">
            <label >{{'ALLOW_WRITEOFF' | translate}}</label>
            <select ng-init="selectedAllowWriteoff = allowValueRange[0]" ng-model="selectedAllowWriteoff" ng-options="i.value for i in allowValueRange"></select>
        </div>
        <div class="_item">
            <label >{{'ALLOW_WHITELIST' | translate}}</label>
            <select ng-init="selectedAllowWhitelist = allowValueRange[0]" ng-model="selectedAllowWhitelist" ng-options="i.value for i in allowValueRange"></select>
        </div>
        <div class="_item">
            <label >{{'ALLOW_BLACKLIST' | translate}}</label>
            <select ng-init="selectedAllowBlacklist = allowValueRange[0]" ng-model="selectedAllowBlacklist" ng-options="i.value for i in allowValueRange"></select>
        </div>
        <div class="_item" ng-show="secpwd">
            <form action="">
                <label >{{'SECOND_PASSWORD' | translate}}</label>
                <input type="password"  ng-model="rasecondPassword"  autocomplete="off">
            </form>
        </div>
        <button class="sent" ng-click="registerAsset()">{{'SUBMIT' | translate}}</button>
    </div>
    <div class="content third myAssets" ng-show="myAssets">
        <p class="title" ng-show="!issuerStatus">{{'NO_ASSET_RELATED_INFORMATION' | translate}}</p>
        <table ng-show="issuerStatus"class="table" ng-table="myAss" border="0" width="100%" cellpadding="0" cellspacing="0"
               template-pagination="custom/pager" >
            <thread>
                <tr>
                    <td>{{'ASSET_NAME' | translate}}</td>
                    <td>{{'MAXIMUM' | translate}}</td>
                    <td>{{'PRECISION' | translate}}</td>
                    <td>{{'QUANTITY' | translate}} </td>
                    <td>{{'CANCELLATION' | translate}}</td>
                    <td>{{'ALLOW_WWB' | translate}}</td>
                    <td>{{'OPERATION' | translate}}</td>
                </tr>
            </thread>
            <tr ng-repeat="i in $data"  >
                <td> {{i.name}}</td>
                <td>{{i.maximumShow}}</td>
                <td>{{i.precision}}</td>
                <td>{{i.quantityShow}}</td>
                <td>{{i.writeoff  }}</td>
                <td>{{i.allowWriteoff ? 'Y' : 'N'}}/{{i.allowWhitelist ? 'Y' : 'N'}}/{{i.allowBlacklist ? 'Y' : 'N'}}</td>
                <td>
                    <span class="writeoff" ng-click="myWriteOff(i)">注销</span>
                    <span class="span publish" ng-click="myPublish(i)">发行</span>
                    <span class="settings" ng-click="mySettings(i)">设置</span>
                    <span class="add" ng-click="myAddPlus(i)">+ACL</span>
                    <span class="remove" ng-click="myreduceACL(i)">-ACL</span>
                    <span class="transtion" ><a class="hand" ng-click="transferView(i,2)">转账</a></span>
                </td>
            </tr>
        </table>
        <div id="writeoff" ng-show="myAss.writeoff">
            <a class="close" href="" ng-click="writeoffClose()"><img src="/assets/common/close.png" alt=""></a>
            <p>您正在注销{{moneyName}}资产，该操作不可逆，需要消耗手续费0.1 XAS</p>
            <div class="_item" ng-show="secpwd">
                <form action="">
                    <label >{{'SECOND_PASSWORD' | translate}}</label>
                    <input type="password" ng-model="wosecondPassword" autocomplete="off">
                </form>
            </div>
            <button class="sent" ng-click="writeoff_submit()">{{'SUBMIT' | translate}}</button>
        </div>
        <div id="publish" ng-show="myAss.publish">
            <a class="close" href="" ng-click="publishClose()"><img src="/assets/common/close.png" alt=""></a>
            <p>您正在发行{{myPublishmoneyName}}资产，该操作不可逆，需要消耗手续费0.1 XAS</p>
            <div class="_item">
                <label >{{'ISSUE_NUMBER' | translate}}</label>
                <input type="text" ng-model="amount" >
            </div>
            <div class="_item" ng-show="secpwd">
                <form action="">
                    <label >{{'SECOND_PASSWORD' | translate}}</label>
                    <input type="password"  ng-model="pbsecondPassword" autocomplete="off">
                </form>
            </div>
            <button class="sent" ng-click="publish_submit()">{{'SUBMIT' | translate}}</button>
        </div>
        <div id="settings" ng-show="myAss.set">
            <a class="close" href="" ng-click="settingsClose()"><img src="/assets/common/close.png" alt=""></a>
            <p>你正在执行{{moneyName}}资产设置操作，需要消耗0.1 XAS</p>
            <div class="_item">
                <label >{{'TYPE' | translate}}</label>
                <input type="text" value="ACL"  disabled>
            </div>
            <div class="_item">
                <label >{{'VALUE' | translate}}</label>
                <input ng-show="acl == 0" type="text" value="黑名单模式"  disabled>
                <input ng-show="acl == 1" type="text" value="白名单模式"  disabled>
            </div>
            <div class="_item" ng-show="secpwd">
                <form action="">
                    <label >{{'SECOND_PASSWORD' | translate}}</label>
                    <input type="password"  ng-model="setsecondPassword" autocomplete="off">
                </form>
            </div>
            <button class="sent" ng-click="settings_submit()">{{'SUBMIT' | translate}}</button>
        </div>
    </div>
    <div class="content third" ng-show="operationRecord">
        <div class="histroy-tablewrap">
            <table class="table"ng-table="operationRecordparams" border="0" width="100%" cellpadding="0" cellspacing="0"
                   template-pagination="custom/pager" >
                <tr ng-repeat="i in $data"  >
                    <td> {{i | histroyFilter }}</td>
                </tr>
            </table>
        </div>
    </div>
    <script type="text/ng-template" id="custom/pager">
        <ul class="pagination ng-table-pagination">
            <li ng-class="{'disabled': !page.active && !page.current, 'active': page.current}" ng-repeat="page in pages" ng-switch="page.type">
                <a ng-switch-when="prev" ng-click="params.page(page.number)" href="">
                    <i class="mdi-hardware-keyboard-arrow-left">{{'PREV_PAGE' | translate}}</i>
                </a>
                <a ng-switch-when="first" ng-click="params.page(page.number)" href="">
                    <span ng-bind="page.number"></span>
                </a>
                <a ng-switch-when="page" ng-click="params.page(page.number)" href="">
                    <span ng-bind="page.number"></span>
                </a>
                <a ng-switch-when="more" ng-click="params.page(page.number)" href="">&#8230;</a>
                <a ng-switch-when="last" ng-click="params.page(page.number)" href="">
                    <span ng-bind="page.number"></span>
                </a>
                <a ng-switch-when="next" ng-click="params.page(page.number)" href="">
                    <i class="mdi-hardware-keyboard-arrow-right">{{'NEXT_PAGE' | translate}}</i>
                </a>
            </li>
        </ul>
    </script>
    <div id="comfirmDialog" ng-show="comfirmDialog">
        <p ng-show="dialogNUM == 1">{{'OPERATION_REQUIRES_FEE' | translate}} {{ publishtrs.fee | xasFilter}} XAS</p>
        <p ng-show="dialogNUM == 2">{{'OPERATION_REQUIRES_FEE' | translate}} {{ assetTrs.fee | xasFilter}} XAS</p>
        <button class="sent1" ng-click="comfirmDialogClose()">{{'CANCEL' | translate}}</button>
        <button class="sent2" ng-click="comfirmSub()">{{'CONFIRM' | translate}}</button>
    </div>
</div>